package com.msb.mall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msb.common.validator.ListValue;
import com.msb.common.validator.groups.AddGroupInterface;
import com.msb.common.validator.groups.GroupInterface;
import com.msb.common.validator.groups.UpdateGroupInterface;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * 品牌
 * jsr303
 * @author lwq
 * @email 1907326957@qq.com
 * @date 2024-06-12 20:30:41
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@NotNull(message = "修改数据品牌id不能为空",groups = {UpdateGroupInterface.class})
	@Null(message = "添加品牌id必须为空",groups = {AddGroupInterface.class})
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotEmpty(message = "品牌名不能为空",groups = {GroupInterface.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotEmpty(message = "logo不能为空",groups = {AddGroupInterface.class})
	@URL(message = "logo必须是一个地址",groups = {GroupInterface.class})
	private String logo;
	/**
	 * 介绍
	 */
	@NotEmpty(message = "介绍不能为空",groups = {GroupInterface.class})
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@ListValue(val={0,1},groups = {GroupInterface.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotEmpty(message = "检索首字母不能为空",groups = {GroupInterface.class})
	@Pattern(regexp = "^[a-zA-Z]$",message = "检索首字母必须是单个的字母",groups = {GroupInterface.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	@NotNull(message = "排序不能为null",groups = {GroupInterface.class})
	@Min(value = 0,message = "排序不能小于0",groups = {GroupInterface.class})
	private Integer sort;

}
